
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xmlns:doc="http://cssbox.sourceforge.net/docs"><head><title>CSSBox Manual</title><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css">
			@import "manual.css";
			</style>
<style type="text/css">
	body {
		background: rgb(199,237,204); /*rgb(199,237,204); #ded; #ddd; #ccc; */
		margin-left: 50px;
		margin-right: 50px;
		font-family: 微软雅黑;
	}
	.subA {
		font-size: 13px;
	}
	.del {
		text-decoration: line-through;
	}
	span {
		border-left: 3px solid #c77;
		padding-left: 5px;
		font-size: 15px;
		font-family: 楷体;
	}
</style>

</head>

<body>

<!--
	* <https://www.cnblogs.com/libin-1/p/5836483.html>
	* "回到顶部"的写法,参考上面的链接地址! 
 -->
<div id="topAnchor"></div>
<a href="#topAnchor" style="position:fixed;left:3px;bottom:20%">顶部</a>


	<h1>
		CSSBox Manual &nbsp;&nbsp; <a class="subA"
			href="http://cssbox.sourceforge.net/manual/manual.html">本文的在线地址</a>
			&nbsp;&nbsp;<a class="subA" href="http://cssbox.sourceforge.net/">cssbox首页</a>
	</h1>
	<p class="author">
		Radek Burget<br /> <a href="mailto:burgetr@fit.vutbr.cz">burgetr@fit.vutbr.cz</a>
	</p>
	
	<div class="toc">
		<h2>Table of Contents</h2>
		<ul>
			<li><a href="#intro">Introduction</a></li>
			<li><a href="#basic">Basic usage</a>
			<ul>
					<li><a href="#basicLoading">Document Loading</a></li>
					<li><a href="#media">Media Support</a></li>
					<li><a href="#basicLayout">Obtaining the Layout</a></li>
					<li><a href="#basicDisplay">Displaying the document</a></li>
					<li><a href="#configOptions">Configuration Options</a></li>
					<li><a href="#parserCustomization">Custom Document Sources
							and Parsers</a></li>
				</ul></li>
			<li><a href="#model">Rendered Document Model</a>
			<ul>
					<li><a href="#modelBox">Basic Box Properties</a></li>
					<li><a href="#modelText">Text Boxes</a></li>
					<li><a href="#modelElement">Element Boxes</a></li>
					<li><a href="#modelInline">Inline Boxes</a></li>
					<li><a href="#modelBlock">Block Boxes</a></li>
					<li><a href="#modelColors">Fonts and Colors</a></li>
				</ul></li>
			<li><a href="#feedback">Feedback</a></li>
		</ul>
	</div>
	
	<div class="section" id="intro">
		<h2>Introduction</h2>
		<p>CSSBox is an (X)HTML/CSS rendering engine written in pure Java.
			Its primary purpose is to provide a complete and further processable
			information about the rendered page contents and layout.</p>
		<p>CSSBox是以纯Java编写的（X）HTML / CSS渲染引擎。 它的主要目的是提供关于呈现的页面内容和布局的完整和可进一步处理的信息。</p>
		<p>This manual gives a short overview of the CSSBox usage. It
			shows how to render a document and it explains how the resulting page
			is represented and how the basic information about the individual
			parts can be obtained.</p>
		<p>本手册简要介绍了CSSBox的用法。 它展示了如何渲染文档，并解释了如何显示结果页面以及如何获得有关各个部分的基本信息。</p>
		<p>
			More detailed information about the individual classes can be
			obtained from the <a href="http://cssbox.sourceforge.net/api/index.html" class="api">API
				documentation</a>.
		</p>
		<p>有关各个类的更详细的信息可以从API文档中获得。</p>
		<p>
			Any feedback to CSSBox and/or this manual is welcome via the <a
				href="http://cssbox.sourceforge.net/">CSSBox website</a>.
		</p>
		<p> <span class="del">任何反馈到CSSBox和/或本手册欢迎通过CSSBox网站。</span> 欢迎反馈</p>
	</div>
	
	<div class="section" id="basic">
		<h2>Basic usage</h2>
		<p>The input of the rendering engine is a document DOM tree. The
			engine is able to automatically load the style sheets referenced in
			the document and it computes the efficient style of each element.
			Afterwrads, the document layout is computed.</p>
			
		<p>渲染引擎的输入是一个文档DOM树。 引擎能够自动加载文档中引用的样式表，并计算每个元素的有效样式。 之后，计算文档布局。</p>
		
		<div class="subsection" id="basicLoading">
			<h3>Document Loading</h3>
			<p>
				CSSBox generally expects an implementation of the <a
					href="http://www.w3.org/DOM/" title="Document Object Model">DOM</a>
				on its input represented by its root
				<code>Document</code>
				node. The way how the DOM is obtained is not important for CSSBox.
				However, in most situations, the DOM is obtained by parsing a HTML
				or XML file. Therefore, CSSBox provides a framework for binding a
				parser to the layout engine. Moreover it contains a default parser
				implementation that may be simply used or it can be easily replaced
				by a custom implementation when required. The default implementation
				is based on the <a href="http://nekohtml.sourceforge.net/">NekoHTML</a>
				parser and <a href="http://xerces.apache.org/xerces2-j/">Xerces
					2</a>. The details about using a different parser are described in the
				<a href="#parserCustomization">Custom Document Sources and
					Parsers</a> section.
			</p>

			<p>CSSBox通常期望在它的根文档节点表示的输入上实现DOM。 DOM的获得方式对于CSSBox并不重要。
				但是，在大多数情况下，DOM是通过解析HTML或XML文件获得的。 因此，CSSBox提供了一个将解析器绑定到布局引擎的框架。
				此外，它还包含一个默认的解析器实现，可以简单地使用，或者在需要时可以很容易地被自定义的实现替换。
				默认实现基于NekoHTML解析器和Xerces 2.有关使用不同解析器的详细信息在“自定义文档源和解析器”部分中进行了介绍。</p>

			<p>With the default implementation, the following code reads and
				parses the document based on its URL:</p>
			
			<p>使用默认实现，以下代码将根据其URL读取并解析文档</p>
			
			<div class="code">
				<pre>
<em>//Open the network connection</em> 
DocumentSource docSource = new DefaultDocumentSource(urlstring);

<em>//Parse the input document</em>
DOMSource parser = new DefaultDOMSource(docSource);
Document doc = parser.parse(); <em>//doc represents the obtained DOM</em>
</pre>
			</div>
<!-- //TODO:  -->
			<p>
				For the initial DOM and style sheet processing, a <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/css/DOMAnalyzer.html" class="api">DOMAnalyzer</a>
				object is used. It is initialized with the DOM tree and the base
				URL:
			</p>
			<p>对于最初的DOM和样式表处理，使用DOMAnalyzer对象。 它使用DOM树和基本URL进行初始化</p>
			<div class="code">
				<pre>
DOMAnalyzer da = new DOMAnalyzer(doc, docSource.getURL());
da.attributesToStyles(); <em>//convert the HTML presentation attributes to inline styles</em>
da.addStyleSheet(null, CSSNorm.stdStyleSheet(), DOMAnalyzer.Origin.AGENT); <em>//use the standard style sheet</em>
da.addStyleSheet(null, CSSNorm.userStyleSheet(), DOMAnalyzer.Origin.AGENT); <em>//use the additional style sheet</em>
da.addStyleSheet(null, CSSNorm.formsStyleSheet(), DOMAnalyzer.Origin.AGENT); <em>//(optional) use the forms style sheet</em>
da.getStyleSheets(); <em>//load the author style sheets</em>
</pre>
			</div>
			<p>
				The <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/css/DOMAnalyzer.html#attributesToStyles()"
					class="api">attributesToStyles()</a> method converts some HTML
				presentation attributes to CSS styles (e.g. the
				<code>&lt;font&gt;</code>
				tag attributes, table attributes and some more). If (X)HTML
				interpretation is not required, this method need not be called. When
				used, this method should be called before
				<code>getStyleSheets()</code>
				is used.
			</p>
			<p>
				attributesToStyles（）方法将一些HTML表示属性转换为CSS样式（例如<font>标记属性，表格属性等等）。
				如果不需要HTML解释，则不需要调用该方法。 使用时，应该在使用getStyleSheets（）之前调用此方法。
			</p>
			<p>
				The <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/css/DOMAnalyzer.html#addStyleSheet(java.net.URL, java.lang.String, org.fit.cssbox.css.DOMAnalyzer.Origin)"
					class="api">addStyleSheet()</a> method is used to add a style sheet
				to the document. The style sheet is passed as a text string
				containing the CSS code. In our case, we add two built-in style
				sheets that represent the standard document style. These style
				sheets are imported as the user agent style sheets according to the
				<a href="http://www.w3.org/TR/CSS21/cascade.html#cascading-order">CSS
					specification</a>. The <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/css/CSSNorm.html#stdStyleSheet()"
					class="api">CSSNorm.stdStyleSheet()</a> method returns the default
				style sheet recommended by the CSS specification and the <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/css/CSSNorm.html#userStyleSheet()"
					class="api">CSSNorm.userStyleSheet()</a> contains some additional
				CSSBox definitions not covered by the standard.
			</p>
			<p>addStyleSheet（）方法用于将样式表添加到文档中。 样式表作为包含CSS代码的文本字符串传递。
				在我们的例子中，我们添加了两个代表标准文档样式的内置样式表。 这些样式表根据CSS规范作为用户代理样式表导入。
				CSSNorm.stdStyleSheet（）方法返回CSS规范推荐的默认样式表，CSSNorm.userStyleSheet（）包含一些标准没有涉及的CSSBox定义。</p>
			<p>
				Optionally, the <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/css/CSSNorm.html#formsStyleSheet()"
					class="api">CSSNorm.formsStyleSheet()</a> includes a basic style of
				form input fields. This style sheet may be used for basic rendering
				of the form fields when their rendering and functionality is not
				implemented in any other way in the application.
			</p>
			<p>可选地，CSSNorm.formsStyleSheet（）包含表单输入字段的基本样式。 这个样式表可以用于表单字段的基本呈现，当它们的呈现和功能没有在应用中以任何其他方式实现时。</p>
			<p>
				Finally, the <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/css/DOMAnalyzer.html#getStyleSheets()"
					class="api">getStyleSheets()</a> method loads and processes all the
				internal and external style sheets referenced from the document
				including the inline style definitions. In case of external style
				sheets, CSSBox tries to obtain the file from the corresponding URL,
				if accessible.
			</p>
			<p>最后，getStyleSheets（）方法加载并处理从文档引用的所有内部和外部样式表，包括内联样式定义。 如果是外部样式表，CSSBox会尝试从相应的URL中获取文件（如果可以访问的话）。</p>
			<p>
				The resulting <a href="http://cssbox.sourceforge.net/api/org/fit/cssbox/css/DOMAnalyzer.html"
					class="api">DOMAnalyzer</a> object represents the document code
				together with the associated style.
			</p>
			<p>生成的DOMAnalyzer对象代表文档代码以及关联的样式。</p>
		</div>
		
		<div class="subsection" id="media">
			<h3>Media Support</h3>
			<p>
				By default, the
				<code>DOMAnalyzer</code>
				assumes that the page is being rendered on a standard desktop
				computer screen. During the style sheet processing, it uses the
				<code>"screen"</code>
				media type and some <a
					href="http://cssbox.sourceforge.net/jstyleparser/api/cz/vutbr/web/css/MediaSpec.html">default
					display feature values</a> for evaluating the possible media queries.
			</p>
			<p>默认情况下，DOMAnalyzer假定页面正在标准台式计算机屏幕上呈现。 在样式表处理期间，它使用“屏幕”媒体类型和一些默认的显示特征值来评估可能的媒体查询。</p>
			<p>
				A different media type or feature values may be specified by
				creating a new <em>media specification</em> represented as a <a
					href="http://cssbox.sourceforge.net/jstyleparser/api/cz/vutbr/web/css/MediaSpec.html">MediaSpec</a>
				object from the <a
					href="http://cssbox.sourceforge.net/jstyleparser/">jStyleParser</a>
				API. The typical usage would be the following:
			</p>
			<p>可以通过从jStyleParser API创建表示为MediaSpec对象的新媒体规范来指定不同的媒体类型或特征值。 典型的用法如下</p>
			<div class="code">
				<pre>
<em>//we will use the "screen" media type for rendering</em>
MediaSpec media = new MediaSpec("screen");

<em>//specify some media feature values</em>
media.setDimensions(1000, 800); <em>//set the visible area size in pixels</em>
media.setDeviceDimensions(1600, 1200); <em>//set the display size in pixels</em>

<em>//use the media specification in the analyzer</em>
DOMAnalyzer da = new DOMAnalyzer(doc, docSource.getURL());
da.setMediaSpec(media);
<em>//... continue with the DOMAnalyzer initialization as above</em>
</pre>
			</div>
			<p>
				The <a
					href="http://github.com/radkovo/CSSBox/blob/master/src/main/java/org/fit/cssbox/demo/BoxBrowser.java">BoxBrowser</a>
				demo shows a basic usage of the media specifications in a Swing
				application.
			</p>
			<p>BoxBrowser演示展示了Swing应用程序中媒体规范的基本用法。</p>
		</div>
		
		<div class="subsection" id="basicLayout">
			<h3>Obtaining the Layout</h3>
			<p>
				The whole layout engine is represented by a graphical <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserCanvas.html" class="api">BrowserCanvas</a>
				object. The simplest way of creating the layout is passing the
				initial viewport dimensions to the BrowserCanvas constructor. Then,
				the layout is computed automatically by creating an instance of this
				object. The remaining constructor arguments are the root DOM
				element, the DOMAnalyzer used for obtaining the element styles and
				the document base URL used for loading images and other referenced
				content.
			</p>
			<p>整个布局引擎由一个图形BrowserCanvas对象表示。
				创建布局最简单的方法是将初始视口尺寸传递给BrowserCanvas构造函数。 然后，通过创建此对象的实例自动计算布局。
				其余的构造函数参数是根DOM元素，用于获取元素样式的DOMAnalyzer和用于加载图像和其他引用内容的文档基URL。</p>
			<div class="code">
				<pre>
BrowserCanvas browser = 
        new BrowserCanvas(da.getRoot(),
                          da,
                          new java.awt.Dimension(1000, 600),
                          url);
</pre>
			</div>
			<p>
				When further browser configuration is required, the BrowserCanvas
				may be created without specifying the viewport dimensions. Then, the
				layout is not computed automatically and it must be created by a
				subsequent call of the <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserCanvas.html#createLayout(java.awt.Dimension)"
					class="api">createLayout</a> method. Before creating the layout,
				the browser configuration may be changed.
			</p>
			<p>当需要进一步的浏览器配置时，可以在不指定视口尺寸的情况下创建BrowserCanvas。
				然后，布局不会自动计算，它必须由createLayout方法的后续调用创建。 在创建布局之前，可能会更改浏览器配置。</p>
			<div class="code">
				<pre>
BrowserCanvas browser = 
        new BrowserCanvas(da.getRoot(), da, url);
<em>//... modify the browser configuration here ...</em>
browser.createLayout(new java.awt.Dimension(1000, 600));
</pre>
			</div>
			<p>
				Optionally, the <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserCanvas.html#createLayout(java.awt.Dimension, java.awt.Rectangle)"
					class="api">createLayout</a> method allows to specify different
				values for the preferred total canvas size and the visible area size
				and position] (the CSS viewport size):
			</p>
			<p>或者，createLayout方法允许指定首选总画布大小和可见区域大小和位置的不同值（CSS视口大小）</p>
			<div class="code">
				<pre>
BrowserCanvas browser = 
        new BrowserCanvas(da.getRoot(), da, url);
<em>//... modify the browser configuration here ...</em>
browser.createLayout(new java.awt.Dimension(1200, 600), new java.awt.Rectangle(0, 0, 1000, 600));
</pre>
			</div>
			<p>In this case, the preferred size of the resulting page is
				1200x600 pixels (it may be adjusted during the layout computation
				based on the page contents) and the size of the visible area is
				1000x600 pixels; the visible area is in the top left corner of the
				rendered page. The visible area size and position is used during the
				layout computation and it may influence the positions of positioned
				elements according to the CSS specification.</p>
			<p>在这种情况下，生成页面的首选尺寸是1200x600像素（可根据页面内容进行布局计算时调整），可见区域的尺寸为1000x600像素;
				可见区域位于渲染页面的左上角。 可视区域的大小和位置是在布局计算中使用的，可能会根据CSS规范影响定位元素的位置。</p>
			<p>
				Setting the visible area size automatically updates the used media
				specification (see the <a href="#media">previous section</a>) so
				that the same size of the visible area is used for evaluating the
				CSS media queries. However, this behavior may be disabled by calling
				<a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserCanvas.html#setAutoMediaUpdate(boolean)"
					class="api">setAutoMediaUpdate(false)</a> before creating the
				layout. In that case, the visible area size used for the layout
				computation may be different from the size used for media queries.
			</p>
			<p>设置可见区域大小会自动更新使用的媒体规范（请参阅上一节），以便使用相同大小的可见区域来评估CSS媒体查询。
				但是，通过在创建布局之前调用setAutoMediaUpdate（false），可能会禁用此行为。
				在这种情况下，用于布局计算的可见区域大小可能与用于媒体查询的大小不同。</p>
			<p>
				In all cases, the created
				<code>browser</code>
				object can be directly used for both displaying the rendered
				document and for obtaining the created layout model. The details of
				the browser configuration are described in the <a
					href="#configOptions">Configuration Options</a> section.
			</p>
			<p>在任何情况下，创建的浏览器对象都可以直接用于显示渲染文档和获取创建的布局模型。 有关浏览器配置的详细信息，请参阅“配置选项”部分。</p>
		</div>
		
		<div class="subsection" id="basicDisplay">
			<h3>Displaying the document</h3>
			<p>
				The <a href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserCanvas.html"
					class="api">BrowserCanvas</a> class is directly derived from the
				Swing
				<code>javax.swing.JPanel</code>
				class. Therefore, it can be directly used as a Swing user interface
				component. The size of the component is automatically adjusted
				according to the resulting document layout. The basic document
				displaying is shown in the <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/demo/SimpleBrowser.html" class="api">SimpleBrowser</a>
				example.
			</p>
			<p>BrowserCanvas类直接从Swing的javax.swing.JPanel类派生。
				因此，它可以直接用作Swing用户界面组件。 组件的大小根据生成的文档布局自动调整。
				SimpleBrowser示例中显示了基本的文档显示。</p>
			<p>
				BrowserCanvas provides a simple display of the rendered page with no
				interactive elements. For obtaining an interactive browser component
				with text selection and clickable links, the <a
					href="http://cssbox.sourceforge.net/swingbox/">SwingBox</a>
				extension should be used.
			</p>
			<p>BrowserCanvas提供了一个没有交互元素的渲染页面的简单显示。 为了获得具有文本选择和可点击链接的交互式浏览器组件，应该使用SwingBox扩展。</p>
		</div>
		
		<div class="subsection" id="configOptions">
			<h3>Configuration Options</h3>
			<p>
				Current browser configuration is represented using a <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserConfig.html" class="api">BrowserConfig</a>
				object that may be accessed using the browser's <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserCanvas.html#getConfig()"
					class="api">getConfig()</a> method. The following configuration
				options are available:
			</p>
			<p>当前的浏览器配置使用可以使用浏览器的getConfig（）方法访问的BrowserConfig对象来表示。 以下配置选项可用</p>
			<dl>
				<dt>
					<a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserConfig.html#setLoadImages(boolean)"
						class="api">browser.getConfig().setLoadImages(boolean)</a>
				</dt>
				<dd>
					Configures whether to load the referenced content images
					automatically. The default value is
					<code>true</code>
					. <span> 配置是否自动加载引用的内容图像 </span>
				</dd>
				<dt>
					<a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserConfig.html#setLoadBackgroundImages(boolean)"
						class="api">browser.getConfig().setLoadBackgroundImages(boolean)</a>
				</dt>
				<dd>
					Configures whether to load the CSS background images automatically.
					The default value is
					<code>true</code>
					. <span> 配置是否自动加载CSS背景图像。 </span>
				</dd>
				<dt>
					<a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserConfig.html#setImageLoadTimeout(int)"
						class="api">browser.getConfig().setImageLoadTimeout(int)</a>
				</dt>
				<dd>Configures the timeout for loading images. The default
					value is 500ms. <span>配置加载图像的超时时间</span> </dd>
				<dt>
					<a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserConfig.html#useHTML(boolean)"
						class="api">browser.getConfig().useHTML(boolean)</a>
				</dt>
				<dd>
					Configures whether the engine should use the HTML extensions or
					not. Currently, the HTML extensions include the following: <span>配置引擎是否应该使用HTML扩展名。 目前，HTML扩展包括以下内容</span>
					<ul>
						<li>Creating replaced boxes for <code>&lt;img&gt;</code>
							elements <span>为 <code>&lt;img&gt;</code> 元素创建替换的框</span>
						</li>
						<li>Using the <code>&lt;body&gt;</code> element background
							for the whole canvas according to the HTML specification 
							<span> 根据HTML规范为整个画布使用 <code> &lt;body&gt; </code> 元素背景 </span>
						</li>
						<li>Support for the embedded <code>&lt;object&gt;</code>
							elements. <span> 支持嵌入的<code>&lt;object&gt;</code>元素。 </span>
						</li>
						<li>Special handling of certain elements such as named
							anchors. <span>特定处理某些元素，如命名锚。</span>
						</li>
					</ul>
					The default value is
					<code>true</code>
					.
				</dd>
				<dt>
					<a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserConfig.html#setDefaultFont(java.lang.String,%20java.lang.String)"
						class="api">browser.getConfig().setDefaultFont(String logical,
						String physical)</a>
				</dt>
				<dd>
					Configures the default physical fonts that should be used instead
					of the logical Java families. The typical usage is the following:
					<span> 配置应该使用的默认物理字体，而不是逻辑Java系列。 典型的用法如下 </span>
					<div class="code">
						<pre>
        browser.getConfig().setDefaultFont(java.awt.Font.SERIF, "Times New Roman");
        browser.getConfig().setDefaultFont(java.awt.Font.SANS_SERIF, "Arial");
        browser.getConfig().setDefaultFont(java.awt.Font.MONOSPACED, "Courier New");
	</pre>
					</div>
				</dd>
				<dt>
					<a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserConfig.html#registerDocumentSource(java.lang.Class)"
						class="api">browser.getConfig().registerDocumentSource(Class&lt;?
						extends DocumentSource&gt;)</a>
				</dt>
				<dt>
					<a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserConfig.html#registerDOMSource(java.lang.Class)"
						class="api">browser.getConfig().registerDOMSource(Class&lt;?
						extends DOMSource&gt;)</a>
				</dt>
				<dd>
					Register the DocumentSource and DOMSource implementation used for
					automatic loading of the referenced documents. See the <a
						href="#parserCustomization">Custom Document Sources and
						Parsers</a> section for details.
					<span>注册用于自动加载引用文档的DocumentSource和DOMSource实现。 有关详细信息，请参阅自定义文档来源和解析器部分。</span>
				</dd>
			</dl>
		</div>
		
		<div class="subsection" id="parserCustomization">
			<h3>Custom Document Sources and Parsers</h3>
			<p>CSSBox contains two generic abstract classes that represent
				the document source and the parser and provides their default
				implementations: </p>
			<p>CSSBox包含两个通用的抽象类，它们代表文档源和解析器，并提供它们的默认实现</p>
			<ul>
				<li><a href="http://cssbox.sourceforge.net/api/org/fit/cssbox/io/DocumentSource.html"
					class="api">DocumentSource</a> represents a generic source of
					documents that is able to obtain a document based on its URL. The
					default <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/io/DefaultDocumentSource.html"
					class="api">DefaultDocumentSource</a> implementation uses the
					standard Java <code>URLConnection</code> mechanism extended by the
					support of <code>data:</code> URL scheme.
				<span>DocumentSource表示能够根据URL获取文档的通用文档来源。
						默认的DefaultDocumentSource实现使用通过支持data：URL方案扩展的标准Java
						URLConnection机制。</span></li> <!-- //TODO: -->
				<li><a href="http://cssbox.sourceforge.net/api/org/fit/cssbox/io/DOMSource.html"
					class="api">DOMSource</a> represents a parser that is able to
					create a DOM from a document source. The default <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/io/DefaultDOMSource.html" class="api">DefaultDOMSource</a>
					implementation is based on the <a
					href="http://nekohtml.sourceforge.net/">NekoHTML</a> parser.
					<span>DOMSource表示一个能够从文档源创建DOM的解析器。 默认的DefaultDOMSource实现基于NekoHTML解析器。</span>
					</li>
			</ul>
			<p>
				The default implementations may be used for obtaining the DOM from
				an URL easily as shown in the <a href="#basicLoading">Document
					Loading</a> section. Moreover, CSSBox uses these implementations for
				obtaining the documents referenced from the HTML code such as images
				and embedded objects.
			</p>
			<p>如文档加载部分所示，可以使用默认实现从URL轻松获取DOM。 而且，CSSBox使用这些实现来获取从HTML代码引用的文档，如图像和嵌入对象。</p>
			<p>
				When a different implementation of the document source or the parser
				is required (e.g. for obtaining the documents from a non-standard
				source, using a different parser implementation, etc.), it is
				possible to create a custom implementation of the appropriate
				abstract class. Then, the new implementation may be registered using
				the browser configuration <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserConfig.html#registerDocumentSource(java.lang.Class)"
					class="api">browser.getConfig().registerDocumentSource()</a> and <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserConfig.html#registerDOMSource(java.lang.Class)"
					class="api">browser.getConfig().registerDOMSource()</a> methods as
				mentioned above in the <a href="#configOptions">Configuration
					Options</a> section.
			</p>
			<p>当需要文档源或解析器的不同实现（例如，从非标准源获取文档，使用不同的解析器实现等）时，可以创建适当的抽象类的自定义实现。
				然后，可以使用浏览器配置browser.getConfig（）。registerDocumentSource（）
				和browser.getConfig（）。registerDOMSource（）方法注册新的实现，如上面在配置选项部分中所述。</p>
		</div>
	</div>

<!-- //TODO: -->
	<div class="section" id="model">
		<h2>Rendered Document Model</h2>
		<p>
			The resulting document layout is represented as a tree of
			<dfn>boxes</dfn>
			. Each box creates a rectangular area in the resulting page and it
			corresponds to a particular rendered HTML element. There may be
			multiple boxes corresponding to a single element; e.g. a multi-line
			paragraph
			<code>&lt;p&gt;</code>
			is split to several line boxes. A box may be either composed from
			child boxes or it may correspond to a particular part of the document
			content, which may be a text string or replaced content (e.g.
			images).
		</p>
		<p>生成的文档布局被表示为一个框的树。 每个框在结果页面中创建一个矩形区域，它对应于一个特定的呈现HTML元素。
			可能有多个对应于单个元素的框; 例如 一个多行段落被分成几行。
			框可以由子框组成，或者可以对应于文档内容的特定部分，其可以是文本串或替换的内容（例如图像）。</p>
		<p>
			Each box is represented by an object which extends the <a
				href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html"
				class="api">Box</a> abstract class. There exist several box types
			that roughly correspond to the computed value of the CSS
			<code>display</code>
			property for the corresponding element. Figure 1 shows the type
			hierarchy of boxes.
		</p>
		<p>每个盒子都由扩展Box抽象类的对象来表示。 存在几个盒子类型，大致对应于相应元素的CSS显示属性的计算值。 图1显示了框的类型层次结构。</p>
		<div class="figure">
			<img src="box_classes.png" alt="Box type hierarchy" />
			<p>Figure 1: Box type hierarchy</p>
		</div>
		<p>
			The root node of the box tree is always represented by a <a
				href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Viewport.html"
				class="api">Viewport</a> object and it represents the browser
			viewport. It has always a single child which is called a
			<dfn>root box</dfn>
			. The root box corresponds to the root element of the HTML code
			passed to the <a
				href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserCanvas.html"
				class="api">BrowserCanvas</a> for rendering. Usually, it is the
			<code>&lt;body&gt;</code>
			element.
		</p>
		<p>
			框树的根节点始终由一个视口对象表示，它表示浏览器视口。 它总是有一个单独的孩子被称为根盒。
			根框对应于传递给BrowserCanvas进行呈现的HTML代码的根元素。 通常，它是
			<code>&lt;body&gt;</code> 元素。
		</p>
		<p>
			The viewport and the root box are obtained using the <a
				href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserCanvas.html#getViewport()"
				class="api">getViewport()</a> and <a
				href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BrowserCanvas.html#getRootBox()"
				class="api">getRootBox()</a> methods of the BrowserCanvas.
		</p>
		<p>使用BrowserCanvas的getViewport（）和getRootBox（）方法获取视口和根框。</p>
		<p>
			In the following chapters, we will mention the most important methods
			that can be used for obtaining information about the resulting
			document layout. For other methods, see the <a
				href="http://cssbox.sourceforge.net/api/index.html" class="api">CSSBox
				API reference</a>.
		</p>
		<p>在下面的章节中，我们将提到可用于获取有关生成的文档布局信息的最重要的方法。 有关其他方法，请参阅CSSBox API参考。</p>
		
		<div class="subsection" id="modelBox">
			<h3>Basic Box Properties</h3>
			<p>
				The basic box properties are defined in the <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html"
					class="api">Box</a> abstract class. They are mostly related to the
				box position and size.
			</p>
			<p>基本框属性在Box抽象类中定义。 它们大多与盒子的位置和大小有关。</p>
			
			<div class="subsubsection" id="boxPositions">
				<h4>Box Position and Size</h4>
				<p>During the layout, the box position is first computed
					relatively to the containing box and in the next step, the absolute
					position in the page is computed. The box occupies a rectangular
					area in the page which includes the box contents, borders and
					margins. The contents of the box is always inside of this area and
					it is again a rectangle which is equal or smaller than the whole
					box. Following methods can be used for obtaining the positions and
					sizes:</p>
				<p>在布局过程中，首先计算框位置相对于包含框的位置，然后在下一步计算页面中的绝对位置。
					该框在页面中占有一个矩形区域，其中包括框内容，边框和边距。 盒子的内容总是在这个区域内，它又是一个等于或小于整个盒子的矩形。
					以下方法可用于获取位置和大小</p>
				<dl>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html#getAbsoluteBounds()"
							class="api">getAbsoluteBounds()</a>
					</dt>
					<dd>
						Returns the absolute box position and size on the page including
						all the borders and margins. The result is the
						<code>java.awt.Rectangle</code>
						object. <span>返回页面上的绝对框位置和大小，包括所有边框和边距</span>
					</dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html#getBounds()"
							class="api">getBounds()</a>
					</dt>
					<dd>Returns the box position and size relatively to the
						top-left corner of the containing block. <span>返回相对于包含块左上角的框位置和大小。</span>
						</dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html#getAbsoluteContentX()"
							class="api">getAbsoluteContentX()</a>
					</dt>
					<dd>The absolute X coordinate of the top left corner of the
						box contents. <span>框内容左上角的绝对X坐标。</span> </dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html#getAbsoluteContentY()"
							class="api">getAbsoluteContentY()</a>
					</dt>
					<dd>The absolute Y coordinate of the top left corner of the
						box contents. <span>框内容左上角的绝对Y坐标。</span> </dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html#getContentX()"
							class="api">getContentX()</a>
					</dt>
					<dd>The absolute X coordinate of the top left corner of the
						box contents relatively to the containing block. <span>框内容的左上角相对于包含块的绝对X坐标。</span> </dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html#getContentY()"
							class="api">getContentY()</a>
					</dt>
					<dd>The absolute Y coordinate of the top left corner of the
						box contents relatively to the containing block.</dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html#getContentWidth()"
							class="api">getContentWidth()</a>
					</dt>
					<dd>The width of the box content without any margins and
						borders.</dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html#getContentHeight()"
							class="api">getContentHeight()</a>
					</dt>
					<dd>The height of the box content without any margins and
						borders. <span>框内容的高度没有任何边距和边界。</span> </dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html"
							class="api"></a>
					</dt>
					<dd></dd>
				</dl>
			</div>
			
			
			
			<div class="subsubsection" id="boxStructure">
				<h4>Box Tree Structure</h4>
				<dl>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html#getParent()"
							class="api">getParent()</a>
					</dt>
					<dd>
						Returns the parent box of this box or
						<code>null</code>
						if this is the root box. <span>返回此框的父框，如果这是根框，则返回null。</span>
					</dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html#getContainingBlock()"
							class="api">getContainingBlock()</a>
					</dt>
					<dd>Returns the containing block for this box. <span>返回此框的包含块。</span> </dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html#getViewport()"
							class="api">getViewport()</a>
					</dt>
					<dd>
						The corresponding <a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Viewport.html"
							class="api">Viewport</a> object (the root of the box tree). <span>相应的视口对象（框树的根）。</span>
					</dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html#getNode()"
							class="api">getNode()</a>
					</dt>
					<dd>The DOM node this box corresponds to. There may be
						multiple boxes corresponding to a single DOM node.
						<span>此框对应的DOM节点。 可能有多个对应于单个DOM节点的框。</span>
						</dd>
				</dl>
			</div>
		</div>
		
		
		<div class="subsection" id="modelText">
			<h3>Text Boxes</h3>
			<p>
				A text box always box corresponds to a DOM node of the type
				<code>Text</code>
				. It is represented as <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/TextBox.html"
					class="api">TextBox</a> object. When the text is split to several
				lines, multiple boxes correspond to a single DOM node. In this case
				each of them contains a corresponding substring of the text.
			</p>
			<p>文本框总是对应于Text类型的DOM节点。 它表示为TextBox对象。 当文本分成几行时，多个框对应一个DOM节点。 在这种情况下，它们中的每一个都包含文本的相应子字符串。</p>
			<div class="subsubsection" id="textText">
				<h4>Obtaining the Text Content</h4>
				<dl>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/TextBox.html#getText()"
							class="api">getText()</a>
					</dt>
					<dd>Returns the text string corresponding to this node. <span>返回与此节点相对应的文本字符串。</span> </dd>
				</dl>
			</div>
		</div>
		
		
		<div class="subsection" id="modelElement">
			<h3>Element Boxes</h3>
			<p>
				An element box corresponds to a DOM node of the type
				<code>Element</code>
				. It is represented as an object of the abstract <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html"
					class="api">ElementBox</a> class. It can be implemented as an
				inline box or a block box as described below. The common methods of
				the element boxes are the following:
			</p>
			<p>元素框对应于Element类型的DOM节点。 它被表示为抽象的ElementBox类的一个对象。 它可以被实现为内联框或块框，如下所述。 元素框的常用方法如下</p>
			<div class="subsubsection" id="elementStructure">
				<h4>Box Tree Structure</h4>
				<p>
					Each element box may contain any number of nested child boxes that
					are indexed from <em>0</em> to <em>n</em>. When there exist
					multiple element boxes that correspond to a single DOM node, all
					these boxes share all the child boxes. The child boxes that belong
					to a particular element box can be determined using their index -
					the <a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html#getStartChild()"
						class="api">getStartChild()</a> and the <a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html#getEndChild()"
						class="api">getEndChild()</a> methods give the first and the last
					index of the child boxes that belong to this particular element
					box. Therefore, the normal way of processing all the child boxes of
					an element box
					<code>b</code>
					is following:
				</p>
				<p>每个元素框可以包含从0到n索引的任意数量的嵌套子框。 当存在多个对应于单个DOM节点的元素框时，所有这些框共享所有的子框。
					属于特定元素框的子框可以使用它们的索引来确定 -
					getStartChild（）和getEndChild（）方法给出属于这个特定元素框的子框的第一个和最后一个索引。
					因此，处理元素框b的所有子框的正常方式如下</p>
				<div class="code">
					<pre>
for (int i = b.getStartChild(); i &lt; b.getEndChild(); i++)
{
    Box sub = b.getSubBox(i);
    <em>//process the child box here...</em>
}
</pre>
				</div>
				<p>The overview of the related ElementBox methods follows:</p>
				<p>下面是相关的ElementBox方法的概述</p>
				<dl>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html#getStartChild()"
							class="api">getStartChild()</a>
					</dt>
					<dd>Returns the index of the first child box contained in this
						element box. <span>返回此元素框中包含的第一个子框的索引。</span> </dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html#getEndChild()"
							class="api">getEndChild()</a>
					</dt>
					<dd>
						Returns the index of the first child box <strong>not</strong>
						contained in this element box. <span>返回未包含在此元素框中的第一个子框的索引。</span>
					</dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html#getSubBox(int)"
							class="api">getSubBox(int)</a>
					</dt>
					<dd>Returns the child box with the given index. <span>返回给定索引的子框。</span> </dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html#getSubBoxNumber()"
							class="api">getSubBoxNumber()</a>
					</dt>
					<dd>The number of child boxes in this box. <span>此框中的子框数量。</span> </dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html#getElement()"
							class="api">getElement()</a>
					</dt>
					<dd>The corresponding DOM Element. <span>相应的DOM元素。</span> </dd>
				</dl>
			</div>
			
			
			<div class="subsubsection" id="elementModel">
				<h4>Box Sizes</h4>
				<p>
					The dimensions of an element box are modelled according to the <a
						href="http://www.w3.org/TR/CSS21/box.html">CSS Box Model</a>. In
					addition to the <em>content size</em> discussed in the <a
						href="#boxPositions"><code>Box interface description</code></a>,
					it consists of <em>padding</em>, <em>border width</em> and <em>margin</em>.
					All these dimensions are represented by objects of a special <a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/LengthSet.html"
						class="api">LengthSet</a> class that contain the
					<code>top</code>
					,
					<code>left</code>
					,
					<code>bottom</code>
					and
					<code>right</code>
					values of the dimension.
				</p>
				<p>元框的尺寸根据CSS框模型进行建模。 除了Box界面描述中讨论的内容大小之外，它还包括填充，边框宽度和边距。
					所有这些维都由包含维度的顶部，左侧，底部和右侧值的特殊LengthSet类的对象表示。</p>
				<p>
					There are two values of <em>margin</em> available: A computed value
					of the margin that corresponds to the specified style and an
					efficient margin value (<em>emargin</em>) that considers the margin
					collapsing and it is used during the layout.
				</p>
				<p>有两个可用的边距值：对应于指定样式的边距的计算值和考虑边距折叠的有效边距值（emargin），并在布局期间使用。</p>
				<p>Following methods can be used for obtaining the individual
					values:</p>
					<p>以下方法可以用于获取单个值</p>
				<dl>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html#getPadding()"
							class="api">getPadding()</a>
					</dt>
					<dd>Returns the padding sizes.</dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html#getBorder()"
							class="api">getBorder()</a>
					</dt>
					<dd>The border sizes.</dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html#getMargin()"
							class="api">getMargin()</a>
					</dt>
					<dd>The computed margin sizes.</dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html#getEMargin()"
							class="api">getEMargin()</a>
					</dt>
					<dd>The efficient margin sizes used during the layout with
						margin collapsing. <span>在边缘折叠的布局中使用的有效边距大小。</span> </dd>
				</dl>
			</div>
			<div class="subsubsection" id="elementVisual">
				<h4>Visual Properties of the Element Box</h4>
				<dl>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html#getDisplay()"
							class="api">getDisplay()</a>
					</dt>
					<dd>
						Represents the value of the
						<code>display:</code>
						CSS property. The returned value is one of the following constants
						defined in the <a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html"
							class="api">ElementBox</a> class:
						<code>DISPLAY_ANY</code>
						,
						<code>DISPLAY_BLOCK</code>
						,
						<code>DISPLAY_INLINE</code>
						,
						<code>DISPLAY_INLINE_BLOCK</code>
						,
						<code>DISPLAY_INLINE_TABLE</code>
						,
						<code>DISPLAY_LIST_ITEM</code>
						,
						<code>DISPLAY_NONE</code>
						,
						<code>DISPLAY_RUN_IN</code>
						,
						<code>DISPLAY_TABLE</code>
						,
						<code>DISPLAY_TABLE_CAPTION</code>
						,
						<code>DISPLAY_TABLE_CELL</code>
						,
						<code>DISPLAY_TABLE_COLUMN</code>
						,
						<code>DISPLAY_TABLE_COLUMN_GROUP</code>
						,
						<code>DISPLAY_TABLE_FOOTER_GROUP</code>
						,
						<code>DISPLAY_TABLE_HEADER_GROUP</code>
						,
						<code>DISPLAY_TABLE_ROW</code>
						,
						<code>DISPLAY_TABLE_ROW_GROUP</code>
						. <span>表示显示的值：CSS属性。 返回值是ElementBox类中定义的以下常量之一</span>
					</dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html#getBgcolor()"
							class="api">getBgcolor()</a>
					</dt>
					<dd>The background color of the element or null when
						transparent. <span>元素的背景颜色或透明时为null。</span> </dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html"
							class="api"></a>
					</dt>
					<dd></dd>
					<dt>
						<a
							href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html"
							class="api"></a>
					</dt>
					<dd></dd>
				</dl>
			</div>
		</div>
		
		
		<div class="subsection" id="modelInline">
			<h3>Inline Boxes</h3>
			<p>
				Inline boxes are the <a href="#modelElement">element boxes</a> with
				value of the CSS
				<code>display:</code>
				property equal to
				<code>inline</code>
				. These boxes are represented as the <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/InlineBox.html"
					class="api">InlineBox</a> objects. They have no special properties
				in addition to the properties defined in the <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html"
					class="api">ElementBox</a> class.
			</p>
			<p>内联框是CSS display：属性等于inline的元素框。 这些框被表示为InlineBox对象。 除了在ElementBox类中定义的属性之外，它们没有特殊的属性。</p>
		</div>
		<div class="subsection" id="modelBlock">
			<h3>Block Boxes</h3>
			<p>
				Block boxes, with the
				<code>display:</code>
				value set to
				<code>block</code>
				are represented by the <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/BlockBox.html"
					class="api">BlockBox</a> objects. In addition, the boxes with other
				values of the
				<code>display:</code>
				property are represented by several special classes derived from
				this class:
			</p>
			<p>显示：值设置为块的块框由块框对象表示。 另外，具有其他display：属性值的框由几个从这个类派生的特殊类来表示</p>
			<ul>
				<li><a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ListItemBox.html"
					class="api">ListItemBox</a></li>
				<li><a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/TableBox.html"
					class="api">TableBox</a></li>
				<li><a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/TableCaptionBox.html"
					class="api">TableCaptionBox</a></li>
				<li><a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/TableBodyBox.html"
					class="api">TableBodyBox</a></li>
				<li><a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/TableRowBox.html"
					class="api">TableRowBox</a></li>
				<li><a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Viewport.html"
					class="api">Viewport</a></li>
			</ul>
			<p>
				These objects differ mainly in the way how the boxes and their
				contents are laid out on the page. From the resulting layout model
				point of view, they have no special properties in addition to the
				properties defined in the <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/ElementBox.html"
					class="api">ElementBox</a> class.
			</p>
			<p>这些对象的主要区别在于如何在页面上显示框和内容。 从生成的布局模型的角度来看，除了在ElementBox类中定义的属性之外，它们没有特殊的属性。</p>
		</div>
		
		
		<div class="subsection" id="modelColors">
			<h3>Fonts and Colors</h3>
			<p>
				For each box, a <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/VisualContext.html"
					class="api">VisualContext</a> object is defined that gathers the
				information about the current text font and color. This object is
				obtained using the <a
					href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/Box.html#getVisualContext()"
					class="api">getVisualContext()</a> method of the box. Following
				methods can be used for obtaining the appropriate information:
			</p>
			<p>对于每个框，定义了一个VisualContext对象，用于收集有关当前文本字体和颜色的信息。
				该对象是使用方框的getVisualContext（）方法获得的。 以下方法可用于获取适当的信息</p>
			<dl>
				<dt>
					<a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/VisualContext.html#getColor()"
						class="api">getColor()</a>
				</dt>
				<dd>Current text color. <span>当前文字颜色。</span> </dd>
				<dt>
					<a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/VisualContext.html#getFont()"
						class="api">getFont()</a>
				</dt>
				<dd>
					Returns the current font represented as the
					<code>java.awt.Font</code>
					object. From this object most of the font properties can be
					obtained.
				</dd>
				<dt>
					<a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/VisualContext.html#getFontVariant()"
						class="api">getFontVariant()</a>
				</dt>
				<dd>
					Current font variant in the CSS syntax - i.e.
					<code>normal</code>
					or
					<code>small-caps</code>
					. <span>返回表示为java.awt.Font对象的当前字体。 从这个对象中可以获得大部分的字体属性。</span>
				</dd>
				<dt>
					<a
						href="http://cssbox.sourceforge.net/api/org/fit/cssbox/layout/VisualContext.html#getTextDecoration()"
						class="api">getTextDecoration()</a>
				</dt>
				<dd>
					Current text decoration in the CSS syntax - i.e.
					<code>none</code>
					,
					<code>underline</code>
					,
					<code>overline</code>
					,
					<code>line-through</code>
					or
					<code>blink</code>
					. <span>CSS语法中的当前文本修饰</span>
				</dd>
			</dl>
			<p>
				The background color is only applicable to <a href="#modelElement">element
					boxes</a> as mentioned in <a href="#elementVisual">Visual
					Properties of the Element Box</a>.
			</p>
			<p>背景颜色只适用于元素框的可视属性中提到的元素框。</p>
		</div>
	</div>

	<div class="section" id="feedback"><h2>Feedback</h2><p>The CSSBox library and this manual are under development. Any feedback is welcome
mainly via the forums and the bug tracker available via the
<a href="http://www.sourceforge.net/projects/cssbox">project page</a>. We will be very
happy if you want to contribute to the code. In this case, please contact the author. 
</p>
<p>CSSBox库和本手册正在开发中。 欢迎任何反馈，主要通过论坛和通过项目页面提供的错误跟踪器。 如果你想贡献代码，我们将非常高兴。 在这种情况下，请联系作者。</p>
</div></body></html>